package com.tencent.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tencent.common.Configure;
import com.tencent.protocol.refund_protocol.RefundReqData;

/**
 * User: rizenguo Date: 2014/10/29 Time: 16:04
 */
public class RefundService extends BaseService {
	
	private Logger logger = LoggerFactory.getLogger(getClass()); 

	public RefundService() throws IllegalAccessException, InstantiationException, ClassNotFoundException {
		super(Configure.REFUND_API);
	}

	/**
	 * 请求退款服务
	 * 
	 * @param refundReqData
	 *            这个数据对象里面包含了API要求提交的各种数据字段
	 * @return API返回的XML数据
	 * @throws Exception
	 */
	public String request(RefundReqData refundReqData) throws Exception {

		// --------------------------------------------------------------------
		// 发送HTTPS的Post请求到API地址
		// --------------------------------------------------------------------
		String responseString = sendPost(refundReqData);
		logger.debug("微信请求退款返回的数据={}", responseString);
		return responseString;
	}

}
